#pragma once 
#include<iostream>
class tickPoint {
public:
	int tick = -1;
	int index = -1;
	int lastTick = -1;
	int lastIndex = -1;

	int updatetimeToIndex(int now) {
		int tickNum = 0;
		int index = 0;
		tickNum = now / 10000000 * 3600 + ((now % 10000000) / 100000) * 60 + (now % 100000) / 1000;
		int open1 = 34200;
		int close1 = 41400;
		int open2 = 46800;
		int close2 = 54000;
		if (tickNum >= open1 && tickNum <= close1) {
			index = (tickNum - open1) / 3;
			if ((tickNum - open1) % 3 > 0) {
				index = index + 1;
			}
		}
		else if (tickNum >= open2 && tickNum <= close2) {
			index = (tickNum - open2) / 3;
			if ((tickNum - open2) % 3 > 0) {
				index = index + 1;
			}
			index = index + 2401;
		}
		else if (tickNum < open1) {
			index = 0;
		}
		else if (tickNum > close1&& tickNum < open2) {
			index = 2400;
		}
		else if (tickNum > close2) {
			index = 4801;
		}

		return index;
	}
};


class marketData {
public:
	double lastPrice = 0;
	double preClosePrice = 0;
	double amount = 0;
	double volume = 0;
	double highestPrice = 0;
	double lowestPrice = 0;
	double upperLimitPrice = 0;
	double lowerLimitPrice = 0;
	double openPrice = 0;
	double askPrice[10] = {};
	double askVolume[10] = {};
	double bidPrice[10] = {};
	double bidVolume[10] = {};
	int tick;
	int date;
	int code;
};
